package cn.iune.erp.baseinfo;

import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

import com.justep.baas.data.RowState;

@Entity
@Table(name="FileFactory",uniqueConstraints={@UniqueConstraint(name="UK832hivrpdkkm31q3cr5xpp3ix",columnNames={"factoryNo", "enterpriseNo"})})
@NamedQuery(name="FileFactory.findAll", query="SELECT s FROM FileFactory s")
public class FileFactory {

	@Id
	@Column(length=36)
	private String fID;
	
	@Column(length=32)
	private String systemCode;
	@Column(length=4)
	private String billType;
	@Column(length=20)
	private String billTypeName;
	private Date orderDate;
	@Column(length=10)
	private String state;
	@Column(length=10)
	private String status;

	@Column(length=4)
	private String factoryNo;
	@Column(length=20)
	private String factoryName;
	
	///////////////////////////////////////////////

	@Column(length=50)
	private String fAddressName;//自提点儿
	@Column(length=128)
	private String fAddressDetail;//详细地址
	
	@Column(length=255)
	private String fAddress;
	
//	@Transient
//	@Column(length=50)
//	private String fRegion;
	@Column(length=50)
	private String fProvince;
	@Column(length=50)
	private String fCity;
	@Column(length=50)
	private String fZone;
	
	@Column(length=100)
	private String fStreet;//街道/小区/乡镇
	@Column(length=50)
	private String fStreetNumber;//单元门牌号

	///////////////////////////////////////////////////////

	@Column(precision=10,scale=6)
	private BigDecimal lat = BigDecimal.ZERO;//纬度
	@Column(precision=10,scale=6)
	private BigDecimal lng = BigDecimal.ZERO;//经度
	@Column(length=4)
	private String cityCode;//城市电话区号/城市代码

	@Column(length=20)
	private String contacts;
	@Column(length=20)
	private String mobilePhone;
	@Column(length=20)
	private String fPhone;
	@Column(length=64)
	private String sMail;//电子邮件
	
	@Column(length=20)
	private String faxPhone;

	@Column(length=20)
	private String qqCode;
	
	@Column(length=20)
	private String postcode;//邮政编码

	
	@Column(length=256)
	private String images;//店铺头像
	@Column(length=256)
	private String summary;//店铺简介

	@Column(length=256)
	private String comments;
	
	@Column(length=15)
	private String cUsercode;
	@Column(length=20)
	private String cUsername;//制单人
	private Timestamp cDatetime;
	@Column(length=15)
	private String tUsercode;
	@Column(length=20)
	private String tUsername;//审核人
	private Timestamp tDatetime;
	@Column(length=15)
	private String eUsercode;
	@Column(length=20)
	private String eUsername;//关单人
	private Timestamp eDatetime;
	
	@Column(length=65)
	private String userId;

	@Column(length=128)
	private String enterpriseNo;
	@Column(length=128)
	private String enterpriseName;

	
	
	//下面是门店信息（零售模块使用）
	@Column(length=1)
	private int iType;//工厂：0，门店：1，网店：2，维修站：9（默认值0）
	
	private int taxType = 1;
	@Column(length=10)
	private String taxTypeLabel = "1.应税内含";
	@Column(precision=10,scale=2)
	private BigDecimal taxRate = BigDecimal.ZERO;
	
	@Column(precision=10,scale=2,columnDefinition="DECIMAL(10,2) default 0")
	private BigDecimal depositRate = BigDecimal.ZERO;//预收定金比例

	//营业时间
	private Time startTime;
	private Time endTime;
		
	
	//是否包邮：0:自定义运费/1:卖家承担运费
	private int freeShipping = 0;
	
	//起步价
	@Column(precision=10,scale=2)
	private BigDecimal startPrice = BigDecimal.ZERO;
	//续费（超出里程9元/公里）或者用米做单位
	@Column(precision=10,scale=2)
	private BigDecimal renewPrice = BigDecimal.ZERO;

	//起送金额（订单金额必须满足才能配送）
	@Column(precision=10,scale=2)
	private BigDecimal startOrderAmount = BigDecimal.ZERO;
	
	//免配送费金额（订单金额必须满足才能免费配送）
	@Column(precision=10,scale=2)
	private BigDecimal freeOrderAmount = BigDecimal.ZERO;
	
	@Column(length=32)
	private String weightsize;//按重量计算还是按容积计算:weight,size，piece
	@Column(length=15)
	private String weightsizeLabel;//按重量计，按容积计，按件计算


	
	@Version
	private int version = 0;
	
	@Transient//非持久字段
	private RowState rowState;
	public RowState getRowState() {
		return rowState;
	}
	public void setRowState(RowState rowState) {
		this.rowState = rowState;
	}
	

	public String getfID() {
		return fID;
	}
	public void setfID(String fID) {
		this.fID = fID;
	}

	public String getFactoryNo() {
		return factoryNo;
	}
	public void setFactoryNo(String factoryNo) {
		this.factoryNo = factoryNo;
	}
	public String getFactoryName() {
		return factoryName;
	}
	public void setFactoryName(String factoryName) {
		this.factoryName = factoryName;
	}
	public String getEnterpriseNo() {
		return enterpriseNo;
	}
	public void setEnterpriseNo(String enterpriseNo) {
		this.enterpriseNo = enterpriseNo;
	}
	public String getEnterpriseName() {
		return enterpriseName;
	}
	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}
	public String getSystemCode() {
		return systemCode;
	}
	public void setSystemCode(String systemCode) {
		this.systemCode = systemCode;
	}
	public String getBillType() {
		return billType;
	}
	public void setBillType(String billType) {
		this.billType = billType;
	}
	public String getBillTypeName() {
		return billTypeName;
	}
	public void setBillTypeName(String billTypeName) {
		this.billTypeName = billTypeName;
	}
	public Date getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getcUsercode() {
		return cUsercode;
	}
	public void setcUsercode(String cUsercode) {
		this.cUsercode = cUsercode;
	}
	public String getcUsername() {
		return cUsername;
	}
	public void setcUsername(String cUsername) {
		this.cUsername = cUsername;
	}
	public Timestamp getcDatetime() {
		return cDatetime;
	}
	public void setcDatetime(Timestamp cDatetime) {
		this.cDatetime = cDatetime;
	}
	public String gettUsercode() {
		return tUsercode;
	}
	public void settUsercode(String tUsercode) {
		this.tUsercode = tUsercode;
	}
	public String gettUsername() {
		return tUsername;
	}
	public void settUsername(String tUsername) {
		this.tUsername = tUsername;
	}
	public Timestamp gettDatetime() {
		return tDatetime;
	}
	public void settDatetime(Timestamp tDatetime) {
		this.tDatetime = tDatetime;
	}
	public String geteUsercode() {
		return eUsercode;
	}
	public void seteUsercode(String eUsercode) {
		this.eUsercode = eUsercode;
	}
	public String geteUsername() {
		return eUsername;
	}
	public void seteUsername(String eUsername) {
		this.eUsername = eUsername;
	}
	public Timestamp geteDatetime() {
		return eDatetime;
	}
	public void seteDatetime(Timestamp eDatetime) {
		this.eDatetime = eDatetime;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public int getVersion() {
		return version;
	}
	public void setVersion(int version) {
		this.version = version;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public String getContacts() {
		return contacts;
	}
	public void setContacts(String contacts) {
		this.contacts = contacts;
	}
	public String getMobilePhone() {
		return mobilePhone;
	}
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}
	public String getfPhone() {
		return fPhone;
	}
	public void setfPhone(String fPhone) {
		this.fPhone = fPhone;
	}
	public String getfAddress() {
		return fAddress;
	}
	public void setfAddress(String fAddress) {
		this.fAddress = fAddress;
	}
	public String getfAddressDetail() {
		return fAddressDetail;
	}
	public void setfAddressDetail(String fAddressDetail) {
		this.fAddressDetail = fAddressDetail;
	}
	public String getsMail() {
		return sMail;
	}
	public void setsMail(String sMail) {
		this.sMail = sMail;
	}
	public String getImages() {
		return images;
	}
	public void setImages(String images) {
		this.images = images;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public String getfProvince() {
		return fProvince;
	}
	public void setfProvince(String fProvince) {
		this.fProvince = fProvince;
	}
	public String getfCity() {
		return fCity;
	}
	public void setfCity(String fCity) {
		this.fCity = fCity;
	}
	public String getfZone() {
		return fZone;
	}
	public void setfZone(String fZone) {
		this.fZone = fZone;
	}
	public String getfAddressName() {
		return fAddressName;
	}
	public void setfAddressName(String fAddressName) {
		this.fAddressName = fAddressName;
	}
	public String getFaxPhone() {
		return faxPhone;
	}
	public void setFaxPhone(String faxPhone) {
		this.faxPhone = faxPhone;
	}
	public String getQqCode() {
		return qqCode;
	}
	public void setQqCode(String qqCode) {
		this.qqCode = qqCode;
	}
	public String getPostcode() {
		return postcode;
	}
	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}
	public BigDecimal getLat() {
		return lat;
	}
	public void setLat(BigDecimal lat) {
		this.lat = lat;
	}
	public BigDecimal getLng() {
		return lng;
	}
	public void setLng(BigDecimal lng) {
		this.lng = lng;
	}
	public String getCityCode() {
		return cityCode;
	}
	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}
	public Time getStartTime() {
		return startTime;
	}
	public void setStartTime(Time startTime) {
		this.startTime = startTime;
	}
	public Time getEndTime() {
		return endTime;
	}
	public void setEndTime(Time endTime) {
		this.endTime = endTime;
	}
	public int getFreeShipping() {
		return freeShipping;
	}
	public void setFreeShipping(int freeShipping) {
		this.freeShipping = freeShipping;
	}
	public BigDecimal getStartPrice() {
		return startPrice;
	}
	public void setStartPrice(BigDecimal startPrice) {
		this.startPrice = startPrice;
	}
	public BigDecimal getRenewPrice() {
		return renewPrice;
	}
	public void setRenewPrice(BigDecimal renewPrice) {
		this.renewPrice = renewPrice;
	}
	public BigDecimal getStartOrderAmount() {
		return startOrderAmount;
	}
	public void setStartOrderAmount(BigDecimal startOrderAmount) {
		this.startOrderAmount = startOrderAmount;
	}
	public BigDecimal getFreeOrderAmount() {
		return freeOrderAmount;
	}
	public void setFreeOrderAmount(BigDecimal freeOrderAmount) {
		this.freeOrderAmount = freeOrderAmount;
	}
	public String getWeightsize() {
		return weightsize;
	}
	public void setWeightsize(String weightsize) {
		this.weightsize = weightsize;
	}
	public String getWeightsizeLabel() {
		return weightsizeLabel;
	}
	public void setWeightsizeLabel(String weightsizeLabel) {
		this.weightsizeLabel = weightsizeLabel;
	}
	public int getTaxType() {
		return taxType;
	}
	public void setTaxType(int taxType) {
		this.taxType = taxType;
	}
	public String getTaxTypeLabel() {
		return taxTypeLabel;
	}
	public void setTaxTypeLabel(String taxTypeLabel) {
		this.taxTypeLabel = taxTypeLabel;
	}
	public BigDecimal getTaxRate() {
		return taxRate;
	}
	public void setTaxRate(BigDecimal taxRate) {
		this.taxRate = taxRate;
	}
	public BigDecimal getDepositRate() {
		return depositRate;
	}
	public void setDepositRate(BigDecimal depositRate) {
		this.depositRate = depositRate;
	}
	public int getiType() {
		return iType;
	}
	public void setiType(int iType) {
		this.iType = iType;
	}
	public String getfStreet() {
		return fStreet;
	}
	public void setfStreet(String fStreet) {
		this.fStreet = fStreet;
	}
	public String getfStreetNumber() {
		return fStreetNumber;
	}
	public void setfStreetNumber(String fStreetNumber) {
		this.fStreetNumber = fStreetNumber;
	}

}
